﻿using System;
using System.Collections.Generic;

namespace Sendz.Domain
{
    // Skipping data annotations and validation in this class since it's primarily a data cross-reference class
    public class AutoResponse
    {
        // Entity
        public Guid AutoResponseKey { get; set; }      
        public DateTime CreatedOn { get; set; }

        // Parents
        public Guid IdentityKey { get; set; }
        public Identity Identity { get; set; }

        public Guid AutoResponderKey { get; set; }
        public AutoResponder AutoResponder { get; set; }

        // Children
        public List<Response> Responses { get; set; }

        // Constructor
        public AutoResponse(Guid identityKey, Guid autoResponderKey)
        {
            // Moved to a calculated column in the Entity Framework ORM (property StoreGeneratedPattern)
            // Ref: http://msdn.microsoft.com/en-us/library/ms189786.aspx
            // Ref: http://leedumond.com/blog/using-a-guid-as-an-entitykey-in-entity-framework-4/
            // this.AutoResponseKey = Guid.NewGuid();
            this.IdentityKey = identityKey;
            this.AutoResponderKey = autoResponderKey;
            this.CreatedOn = DateTime.Now;
        }
    }
}
